﻿import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//引入图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import piniaPersist from 'pinia-plugin-persistedstate'

const app = createApp(App)

const pinia = createPinia()
//pinia使用持久化插件
pinia.use(piniaPersist)
app.use(pinia)

app.use(router)
//使用ElementPlus组件
app.use(ElementPlus)
//全局注册图标库
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  //图标注册成全局组件,组件名称是图标名称
  app.component(key, component)
}
app.mount('#app')
